package com.isoft.demooa.controller.employee;

import com.isoft.demooa.entity.Dept;
import com.isoft.demooa.entity.Edu;
import com.isoft.demooa.entity.ResponseMessage;
import com.isoft.demooa.entity.employee.Normal;
import com.isoft.demooa.service.DeptService;
import com.isoft.demooa.service.EduService;
import com.isoft.demooa.service.employee.NormalService;
import org.apache.ibatis.annotations.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/nor")
@CrossOrigin
public class NormalController {


    @Autowired
    private EduService eduService;

    @Autowired
    private DeptService deptService;

    @Autowired
    private NormalService normalService;


    @RequestMapping("/list")
    public List<Normal> getList(){
        return  normalService.getList();
    }


    @RequestMapping("/edit")
    public ResponseMessage edit(Normal normal){
        return  normalService.edit(normal);
    }

    @RequestMapping("/add")
    public ResponseMessage add(Normal normal){
        return  normalService.add(normal);
    }


    @RequestMapping("/edu")
    private List<Edu> getEduList(){
        return  eduService.getList();
    }


    @RequestMapping("/dept")
    public List<Dept> getDeptList(){
         return  deptService.getList();
    }
}

